From news-rocq.inria.fr!julienas!mcsun!howland.reston.ans.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811s Mon Nov 15 15:42:29 1993 Article: 205 of rec.games.corewar Newsgroups: rec.games.corewar Path: news-rocq.inria.fr!julienas!mcsun!howland.reston.ans.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811s From: pk6811s@acad.drake.edu Subject: '94 and the self-repair problem Message-ID: <1993Nov14.235014.1@acad.drake.edu> Lines: 127 Sender: news@dunix.drake.edu (USENET News System) Nntp-Posting-Host: acad.drake.edu Organization: Drake University, Des Moines, Iowa, USA Date: Mon, 15 Nov 1993 05:50:14 GMT In the interest of promoting the '94 standard, here is the code for a self-repairing fighter 'bunker'. It's not particularly successful, but maybe illustrates some '94 possibilities. First, I had the idea that a self-repairing program could be built like 'paper', using multiple processes. There would be a pair of them, each keeping track of the other's code and repairing it if necessary. Instead of using 'cmp' like the previous self-repairers I wrote, this one would use 'add' or 'sub' to add the b-operands of all the instructions and compare the total to an expected value. If not equal, dat-bomb the damaged partner to kill off any spl-created processes, then recopy the good code and start him again. Speaking only '88 standard to start, I wrote an '88 version, and played around with it for a while. Using a graphical display (Redcoder) I could watch it repairing code over and over when opposed by either bombers or spl-jmp cmp-scanners. Unfortunately it eventually succombed to a rapid combination of hits on both partners, or to being overrun by a djn-stream while in the process of repairing the other partner. It became obvious that it needed to run much faster. The limiting factor in speed is the length of code, since that is also the number of processes needed in each partner. I got to thinking about what could be done with the '94 standard and thought I could pare off 4 instructions under '94, which was almost true as I found out. The program starts by copying the two partners into core, spaced 4000, then starts both copies. Each partner continually monitors the other with this code: set mov initrp,rp sub.ba rb ; kill partner mov rb,>rclr+200 ; wait for partner to die mov 200 ; slow forward core-clear jmp set,#1010 initrp dat #0-2353,#re-rp+1+space rc dat <2667,#1 ; imp-killing, plus djn-stream disrupt re dat <2667,#re-rb+1+space ; for quick restore of partner st mov #0,rclr+boot+space+200 mov #100,rclr+boot+200 spl 1 ; create 14 processes spl 1 mov -1,0 spl 1 spl s2 mov